// **********Mr HGA उर्फ ऋतिक गडरियाल आनंद************
// ¯\_(ツ)_/¯
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define nl '\n'
#define F first
#define S second
#define vvi vector<vector<int>>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define vpii vector<pair<int, int>>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
#define all(x) x.begin(), x.end()
#define vl vector<long long>
#define mii map<int, int>
#define pqb priority_queue<int>
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);\
cout.tie(NULL);
#define rsort(a) sort(a.rbegin(), a.rend())
#define get_sum(a) accumulate(a.begin(), a.end(), 0LL)
#define get_max(a) *max_element(a.begin(), a.end())
#define get_min(a) *min_element(a.begin(), a.end())
#define setbits(x) __builtin_popcountll(x)
#define int long long int
using namespace std;
#define mod 1e5+7
#define w(t) \
int t; \
cin >> t; \
while(t--)
#define goog(t) \
int t; \
cin >> t; \
for(int i=1;i<=t;i++){ \
cout << "Case #" << i << ": "; solve(); \
}
#define f(i, x,y) for (int i = x; i < y; i++)
//*************************DSU Snippets****************************
// vi par(mod),rnk(mod);
// void make_set(int n)
// {
// for(int i=1; i<=n; i++)
// {
// par[i]=i;
// rnk[i]=1;
// }
// }
// int find_set(int x)
// {
// if(par[x]==x)
// {
// return x;
// }
// par[x]=find_set(par[x]);
// return par[x];
// }
// void union_set(int a, int b)
// {
// int p1=find_set(a);
// int p2=find_set(b);
// if(p1==p2)
// return;
// if(rnk[p1]>=rnk[p2])
// {
// par[p2]=p1;
// rnk[p1]+=rnk[p2];
// }
// else
// {
// par[p1]=p2;
// rnk[p2]+=rnk[p1];
// }
// }
//************************************************************//
void solve(){
int n; cin>>n;
if(n%2==0) {cout<<-1<<nl; return;}
vi ans;
while(n!=1){
if(((n+1)/2)%2!=0){
ans.pb(1);
n = (n+1)/2;
}
else {
ans.pb(2);
n=(n-1)/2;
}
}
ans.pb(1);
reverse(all(ans));
cout<<ans.size()<<nl;
for(auto i: ans) cout<<i<<" ";
cout<<nl;
}
int32_t main(){
IOS
w(t)
{
solve();
}
// goog(t)
}
1713C - Build Permutation | 1699A - The Third Three Number Problem |
1617B - GCD Problem | 841A - Generous Kefa |
1690B - Array Decrements | 1692C - Where's the Bishop |
104A - Blackjack | 1438A - Specific Tastes of Andre |
1711C - Color the Picture | 1194C - From S To T |
110B - Lucky String | 1114A - Got Any Grapes |
224B - Array | 125B - Simple XML |
567B - Berland National Library | 431B - Shower Line |
282C - XOR and OR | 1582B - Luntik and Subsequences |
609A - Флеш-карты | 1207A - There Are Two Types Of Burgers |
371C - Hamburgers | 343B - Alternating Current |
758B - Blown Garland | 1681B - Card Trick |
1592A - Gamer Hemose | 493D - Vasya and Chess |
1485A - Add and Divide | 337B - Routine Problem |
1392D - Omkar and Bed Wars | 76E - Points |